package com.ruoyi.utils;

import java.util.Random;

/**
 * 获取 随机数
 */
public class RandomUtils {

    static char[]  chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".toCharArray();

    /**
     *
     * @param num 生成的长度
     * @return
     */
    public static String getRandomSalt(int num){
        String str = "";
        for (int i = 0; i<num; i++){
            str += chars[new Random().nextInt(chars.length)];
        }
        return str;
    }

}
